(ftfont_pattern_entity): Return a newly allocated
authorKenichi Handa <handa@m17n.org>
Fri, 17 Apr 2009 00:55:41 +0000 (00:55 +0000)
committerKenichi Handa <handa@m17n.org>
Fri, 17 Apr 2009 00:55:41 +0000 (00:55 +0000)
entity even if the cache hits.

src/ftfont.c

index 8b0bb06a886509e6b7b8f411ceeba56b56a8d2c2..fdc6bc03bca254847b207f3284a26e6891e55dce 100644 (file)
@@ -208,7 +208,14 @@ ftfont_pattern_entity (p, extra)
   cache = ftfont_lookup_cache (key, FTFONT_CACHE_FOR_ENTITY);
   entity = XCAR (cache);
   if (! NILP (entity))
-    return entity;
+    {
+      Lisp_Object val = font_make_entity ();
+      int i;
+
+      for (i = 0; i < FONT_OBJLIST_INDEX; i++)
+       ASET (val, i, AREF (entity, i));
+      return val;
+    }
   entity = font_make_entity ();
   XSETCAR (cache, entity);